package oa.hleast.xswl.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 用户信用操作类型 及相应操作的分数规则 用于记录操作 枚举
 *
 * @author 302
 * @date 2021/06/02
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum CreditOperatingAndRuleEnum {
    // 0 全部
    ALL(0, "全部", 0, 0),
    //    1身份绑定
    IDENTITY_BINDING(1, "身份绑定", 50, 0),
    //    2培训签到
    TRAINING_SIGN_IN(2, "培训签到", 1, -1),
    //    3场馆预约
    VENUE_RESERVATION(3, "场馆预约", 1, -1),
    //    4入校运动
    ENTRANCE_MOVEMENT(4, "入校运动预约", 1, -1),
    //    5垂钓预约
    FISHING_RESERVATION(5, "垂钓预约", 1, -1),
    //    6图书馆活动
    LIBRARY_ACTIVITIES(6, "图书馆活动预约", 1, -1),
    //    7文化馆活动
    CULTURAL_CENTER_ACTIVITIES(7, "文化馆活动预约", 1, -1),
    //    8当月累计使用
    CUMULATIVE_USE(8, "当月累计使用", 15, 0),
    //   9管理操作
    MANAGER(9, "管理员操作", 0, 0);

    private Integer code;
    private String operatingName;
    private Integer increasePoint;
    private Integer subtractionPoint;

    public static CreditOperatingAndRuleEnum getEnum(Integer code) {
        for (CreditOperatingAndRuleEnum value : CreditOperatingAndRuleEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

}
